***********************************************************************************************************************
******Replcation files for RM Wood "The Consequences of Violence for Women's Candidacy in Legislative Elections: Insights from a Global Analysis"
******International Studies Quarterly
******
******All analyses conducted with Stata 19.5
**********************************************************************************************************************
*

clear all
	 set more off
	

cd "~/Dropbox/Leverhulme_projects/Women Violence Election/manuscripts/Female candidacy/ISQ_RR/ISQ_submission/ISQ_final"

use "wood_ISQ_2025_replication.dta"

log using "Wood_ISQ_replication.smcl"

***********************************************************************************************************************

***Figure 1
*
**Figure is created from combining two figures. I present them separately here and can be edited and joined manually***
***********************************************************************************************************************
kdensity diff_API_IPU if  v2elmulpar_ord > 1

graph save "Graph" "Fig1a.gph", replace

scatter API_direct IPU_or_other if diff_API_IPU !=. & v2elmulpar_ord > 1 , mlabel(country_name) || line (IPU_API IPU_API)

graph save "Graph" "Fig1b.gph", replace

graph combine figure1a.gph figure1b.gph

graph save "Graph" "Fig1_combine.gph", replace
***********************************************************************************************************************
*****Figures 2 & 3*****

**See below; require change in dataset****
***********************************************************************************************************************

***********************************************************************************************************************
***Figure 4 (and Appendix Table A1)
***********************************************************************************************************************

***2-8 months window"

xtset ccode election_counterVdem

**Model 1

xtreg IPU_API ln_events_2_8mos i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result1

*Model 2

xtreg IPU_API ln_events_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result2


*Model 3

xtreg IPU_API ln_events_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result3


**Model 4

xtreg IPU_API ln_all_deaths_2_8mos i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result4


*Model 5

xtreg IPU_API ln_all_deaths_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result5


*Model 6

xtreg IPU_API ln_all_deaths_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth  i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result6


coefplot result1 result2 result3, bylabel(Lethal Events)  || result4 result5 result6 , bylabel(Deaths) keep(ln_all_deaths_2_8mos ln_events_2_8mos v2cagenmob quota reserved_seats pr_system lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth national_party_select01) order(ln_events_2_8mos ln_all_deaths_2_8mos v2cagenmob quota reserved_seats pr_system national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth) xlabel(, labsize(small)) xline(0, lwidth(vthin))  ylabel(, labsize(small)) byopts(rows(1) legend(off))  levels(95) msize(vsmall) mcolor(black..) ciopts(recast(rcap)lwidth(vthin) lcolor(gs10))

***********************************************************************************************************************
****Figure 5: Disaggregated By Violence type (and Appendix Table A2)
***********************************************************************************************************************

**Model 1c

xtreg IPU_API ln_civil_events_2_8mos ln_nonstate_events_2_8mos ln_int_events_2_8mos i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result1c


*Model 2c

xtreg IPU_API ln_civil_events_2_8mos ln_nonstate_events_2_8mos ln_int_events_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result2c


*Model 3c

xtreg IPU_API ln_civil_events_2_8mos ln_nonstate_events_2_8mos ln_int_events_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result3c


**Model 4c

xtreg IPU_API ln_civil_deaths_2_8mos ln_nonstate_deaths_2_8mos ln_int_deaths_2_8mos i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result4c


*Model 5c

xtreg IPU_API ln_civil_deaths_2_8mos ln_nonstate_deaths_2_8mos ln_int_deaths_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result5c


*Model 6c

xtreg IPU_API ln_civil_deaths_2_8mos ln_nonstate_deaths_2_8mos ln_int_deaths_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth  i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result6c



coefplot result1c result2c result3c , bylabel(Lethal Events)  || result4c result5c result6c , bylabel(Deaths) keep(ln_civil_events_2_8mos ln_nonstate_events_2_8mos ln_int_events_2_8mos ln_civil_deaths_2_8mos ln_nonstate_deaths_2_8mos ln_int_deaths_2_8mos) order(ln_civil_events_2_8mos ln_nonstate_events_2_8mos ln_int_events_2_8mos ln_civil_deaths_2_8mos ln_nonstate_deaths_2_8mos ln_int_deaths_2_8mos v2cagenmob quota reserved_seats pr_system lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth national_party_select01) xlabel(, labsize(small)) xline(0, lwidth(vthin))  ylabel(, labsize(small)) byopts(rows(1) legend(off))  levels(95) msize(vsmall) mcolor(black..) ciopts(recast(rcap)lwidth(vthin) lcolor(gs10))

***********************************************************************************************************************
***********************************************************************************************************************
***********************************************Appendix Results********************************************************

*****Table A1 (see above for commands)

*****Table A2 (see above for commands)
***********************************************************************************************************************

****Figure A1 Count of Elections Coded by Country

graph hbar coded_election_total  if v2elmulpar_ord > 1 & proportion_elections !=., over(country_name, sort(1)) 

graph save "Graph" "FigA1.gph", replace

****Figure A2 Proportion of Elections Coded by Country

graph hbar proportion_elections if v2elmulpar_ord > 1 & proportion_elections !=., over(country_name, sort(1)) 

graph save "Graph" "FigA2.gph", replace


****Figure A3: Proportion of Elections Coded by Country over Regions

****Note: Figures require manual adjustment to label sizes for readability and presentation. 

graph hbar proportion_elections if v2elmulpar_ord > 1 & proportion_elections !=. & e_regionpol_6C==1, over(country_name, sort(1)) 

graph save "Graph" "FigA3_a.gph", replace

graph hbar proportion_elections if v2elmulpar_ord > 1 & proportion_elections !=. & e_regionpol_6C==2, over(country_name, sort(1)) 

graph save "Graph" "FigA3_b.gph", replace

graph hbar proportion_elections if v2elmulpar_ord > 1 & proportion_elections !=. & e_regionpol_6C==3, over(country_name, sort(1)) 

graph save "Graph" "FigA3_c.gph", replace

graph hbar proportion_elections if v2elmulpar_ord > 1 & proportion_elections !=. & e_regionpol_6C==4, over(country_name, sort(1)) 

graph save "Graph" "FigA3_d.gph", replace

graph hbar proportion_elections if v2elmulpar_ord > 1 & proportion_elections !=. & e_regionpol_6C==5, over(country_name, sort(1)) 

graph save "Graph" "FigA3_e.gph", replace

graph hbar proportion_elections if v2elmulpar_ord > 1 & proportion_elections !=. & e_regionpol_6C==6, over(country_name, sort(1)) 

graph save "Graph" "FigA3_f.gph", replace


graph combine FigA3_a.gph FigA3_b.gph FigA3_c.gph FigA3_d.gph  FigA3_e.gph FigA3_f.gph, ycommon

***********************************************************************************************************************
***Figure A4: Predictors of Missingness
***********************************************************************************************************************

xi: logit missing v2x_polyarchy year lag_women_leg_fill lngdppc_carry pr_system quota civil_war_new i.e_regionpol_6C, cl(ccode)

est store result1d

coefplot result1d, bylabel(PR(missing)) drop(_cons) xlabel(, labsize(small)) xline(0, lwidth(vthin))  ylabel(, labsize(small)) byopts(rows(1) legend(off))  levels(95) msize(vsmall) mcolor(black..) ciopts(recast(rcap)lwidth(vthin) lcolor(gs10))


***********************************************************************************************************************
****Figure 5: Distribution of Regime Types
***********************************************************************************************************************

**distribution of plyarchy for sample (of coded cases excluding single party and no party competition states)

hist v2x_polyarchy if v2elmulpar_ord > 1 & IPU_API !=., percent bin(25)

graph save "Graph" "FigA5.gph", replace

***********************************************************************************************************************
****Figure A6: Inclusion of Single Party and Fully Autocratic Cases
***********************************************************************************************************************

*Model 1

xtreg IPU_API ln_events_2_8mos i.year, fe cl(ccode)

est store result1e

*Model 2

xtreg IPU_API ln_events_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill i.year, fe cl(ccode)

est store result2e


*Model 3

xtreg IPU_API ln_events_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year, fe cl(ccode)

est store result3e


**Model 4

xtreg IPU_API ln_all_deaths_2_8mos i.year, fe cl(ccode)

est store result4e


*Model 5

xtreg IPU_API ln_all_deaths_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill i.year, fe cl(ccode)

est store result5e


*Model 6

xtreg IPU_API ln_all_deaths_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth  i.year , fe cl(ccode)

est store result6e


coefplot result1e result2e result3e, bylabel(Lethal Events)  || result4e result5e result6e , bylabel(Deaths) keep(ln_all_deaths_2_8mos ln_events_2_8mos v2cagenmob quota reserved_seats pr_system lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth national_party_select01) order(ln_events_2_8mos ln_all_deaths_2_8mos v2cagenmob quota reserved_seats pr_system national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth) xlabel(, labsize(small)) xline(0, lwidth(vthin))  ylabel(, labsize(small)) byopts(rows(1) legend(off))  levels(95) msize(vsmall) mcolor(black..) ciopts(recast(rcap)lwidth(vthin) lcolor(gs10))

***********************************************************************************************************************
***Figure A7 created manually by summing the cases in each category listed in the accompanying table in the appendix.
***********************************************************************************************************************

***********************************************************************************************************************
***Figure A8: : Results Using Different Temporal Windows for Violence)
***********************************************************************************************************************


****3-9 month***


*Model 3

xtreg IPU_API ln_events_3_9mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result3f

**Model 6

xtreg IPU_API ln_all_deaths_3_9mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth  i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result6f


***********************************************************************************************************************
******Lags adjusted base on estimated election date******
***********************************************************************************************************************

*Model 3

xtreg IPU_API ln_events_adjusted v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result3g


*Model 6

xtreg IPU_API ln_all_deaths_adjusted v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth  i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result6g

***********************************************************************************************************************
*****Lags set 6-12 months*****
***********************************************************************************************************************
*Model 3

xtreg IPU_API ln_events_6_12 v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result3h


*Model 6

xtreg IPU_API ln_all_deaths_6_12 v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth  i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result6h


coefplot result3 result3f result3h result3g, bylabel(Lethal Events)  || result6 result6f result6h result6g , bylabel(Deaths) keep(ln_all_deaths_2_8mos ln_events_2_8mos ln_all_deaths_3_9mos ln_events_3_9mos ln_all_deaths_adjusted ln_events_adjusted ln_all_deaths_6_12mos ln_events_6_12mos) order(ln_events_2_8mos ln_events_3_9mos ln_events_6_12mos ln_events_adjusted ln_all_deaths_2_8mos  ln_all_deaths_3_9mos ln_all_deaths_6_12mos ln_all_deaths_adjusted) xlabel(, labsize(small)) xline(0, lwidth(vthin))  ylabel(, labsize(small)) byopts(rows(1) legend(off))  nooffsets msize(small) mcolor(black) mlabel format(%9.2g) mlabposition(12) mlabgap(*2)   levels(95) msize(small) mcolor(black..) ciopts(recast(rcap)lwidth(vthin) lcolor(gs5))




***********************************************************************************************************************
***Figure A9: Alternative Samples
***********************************************************************************************************************

*Model 1 (Excl Reserve Seats)

xtreg IPU_API ln_events_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year if v2elmulpar_ord > 1 & reserve==0, fe cl(ccode)

est store result1i

*Model 2 (Excl Global North)

xtreg IPU_API ln_events_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year if v2elmulpar_ord > 1 & e_regionpol_6C !=5, fe cl(ccode)

est store result2i

*Model 3 (Excl post-2000 elections)

xtreg IPU_API ln_events_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year if v2elmulpar_ord > 1 & year > 2000, fe cl(ccode)

est store result3i

*Model 4 (Excl Reserve Seats)

xtreg IPU_API ln_all_deaths_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year if v2elmulpar_ord > 1 & reserve==0, fe cl(ccode)

est store result4i

*Model 5 (Excl Global North)


xtreg IPU_API ln_all_deaths_2_8mos quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year if v2elmulpar_ord > 1 & e_regionpol_6C !=5, fe cl(ccode)

est store result5i


*Model 6 (Excl post-2000 elections)

xtreg IPU_API ln_all_deaths_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year if v2elmulpar_ord > 1 & year > 2000, fe cl(ccode)

est store result6i


coefplot result1i result2i result3i, bylabel(Lethal Events)  || result4i result5i result6i , bylabel(Deaths) keep(ln_all_deaths_2_8mos ln_events_2_8mos v2cagenmob quota reserved_seats pr_system lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth national_party_select01) order(ln_events_2_8mos ln_all_deaths_2_8mos v2cagenmob quota reserved_seats pr_system national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth) xlabel(, labsize(small)) xline(0, lwidth(vthin))  ylabel(, labsize(small)) byopts(rows(1))  levels(95) msize(vsmall) mcolor(black..) ciopts(recast(rcap)lwidth(vthin) lcolor(gs10))


***********************************************************************************************************************
***Figure A10: Alternative Samples (Disaggregate Violence Measures)
***********************************************************************************************************************



*Model 1 (Excl Reserve Seats)

xtreg IPU_API ln_civil_events_2_8mos ln_nonstate_events_2_8mos ln_int_events_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year if v2elmulpar_ord > 1 & reserve==0, fe cl(ccode)

est store result1j

*Model 2 (Excl Global North)

xtreg IPU_API ln_civil_events_2_8mos ln_nonstate_events_2_8mos ln_int_events_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year if v2elmulpar_ord > 1 & e_regionpol_6C !=5, fe cl(ccode)

est store result2j

*Model 3 (Excl post-2000 elections)

xtreg IPU_API ln_civil_events_2_8mos ln_nonstate_events_2_8mos ln_int_events_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year if v2elmulpar_ord > 1 & year > 2000, fe cl(ccode)

est store result3j

*Model 4 (Excl Reserve Seats)

xtreg IPU_API ln_civil_deaths_2_8mos ln_nonstate_deaths_2_8mos ln_int_deaths_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year if v2elmulpar_ord > 1 & reserve==0, fe cl(ccode)

est store result4j

*Model 5 (Excl Global North)


xtreg IPU_API ln_civil_deaths_2_8mos ln_nonstate_deaths_2_8mos ln_int_deaths_2_8mos quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year if v2elmulpar_ord > 1 & e_regionpol_6C !=5, fe cl(ccode)

est store result5j


*Model 6 (Excl post-2000 elections)

xtreg IPU_API ln_civil_deaths_2_8mos ln_nonstate_deaths_2_8mos ln_int_deaths_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year if v2elmulpar_ord > 1 & year > 2000, fe cl(ccode)

est store result6j


coefplot result1j result2j result3j, bylabel(Lethal Events)  || result4j result5j result6j , bylabel(Deaths) keep(ln_civil_events_2_8mos ln_nonstate_events_2_8mos ln_int_events_2_8mos ln_civil_deaths_2_8mos ln_nonstate_deaths_2_8mos ln_int_deaths_2_8mos v2cagenmob quota reserved_seats pr_system lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth national_party_select01) order(ln_civil_events_2_8mos ln_nonstate_events_2_8mos ln_int_events_2_8mos ln_civil_deaths_2_8mos ln_nonstate_deaths_2_8mos ln_int_deaths_2_8mos v2cagenmob quota reserved_seats pr_system national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth) xlabel(, labsize(small)) xline(0, lwidth(vthin))  ylabel(, labsize(small)) byopts(rows(1))  levels(95) msize(vsmall) mcolor(black..) ciopts(recast(rcap)lwidth(vthin) lcolor(gs10))

***********************************************************************************************************************
***Figure A11: Results Disaggregated by Source Data for Female Candidacy Rate
***********************************************************************************************************************

*Model 1 (IPU)


xtreg IPU_or_other ln_events_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result1k


xtreg IPU_or_other ln_all_deaths_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result2k


*Model 3 (Gender API)

xtreg API_direct ln_events_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result3k

*Model 4

xtreg API_direct ln_all_deaths_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth i.year if v2elmulpar_ord > 1, fe cl(ccode)

est store result4k


coefplot result1k result2k, bylabel(IPU & Other Sources)  || result3k result4k , bylabel(Gender API-coded) keep(ln_all_deaths_2_8mos ln_events_2_8mos v2cagenmob quota reserved_seats pr_system lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth national_party_select01) order(ln_events_2_8mos ln_all_deaths_2_8mos v2cagenmob quota reserved_seats pr_system national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth) xlabel(, labsize(small)) xline(0, lwidth(vthin))  ylabel(, labsize(small)) byopts(rows(1))  levels(95) msize(vsmall) mcolor(black..) ciopts(recast(rcap)lwidth(vthin) lcolor(gs10))





*********************************************************************************************************************

***Figure A12 (Results using Year Variable and Country Fixed Effects)
***********************************************************************************************************************

***2-8 months window"

xtset ccode election_counterVdem

**Model 1

xtreg IPU_API ln_events_2_8mos year if v2elmulpar_ord > 1, fe cl(ccode)

est store result1l

*Model 2

xtreg IPU_API ln_events_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill year if v2elmulpar_ord > 1, fe cl(ccode)

est store result2l


*Model 3

xtreg IPU_API ln_events_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth year if v2elmulpar_ord > 1, fe cl(ccode)

est store result3l


**Model 4

xtreg IPU_API ln_all_deaths_2_8mos year if v2elmulpar_ord > 1, fe cl(ccode)

est store result4l


*Model 5

xtreg IPU_API ln_all_deaths_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill year if v2elmulpar_ord > 1, fe cl(ccode)

est store result5l


*Model 6

xtreg IPU_API ln_all_deaths_2_8mos v2cagenmob quota reserve pr_ national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth  year if v2elmulpar_ord > 1, fe cl(ccode)

est store result6l


coefplot result1l result2l result3l, bylabel(Lethal Events)  || result4l result5l result6l , bylabel(Deaths) keep(ln_all_deaths_2_8mos ln_events_2_8mos v2cagenmob quota reserved_seats pr_system lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth national_party_select01 year) order(ln_events_2_8mos ln_all_deaths_2_8mos v2cagenmob quota reserved_seats pr_system national_party_select01 lag_women_leg_fill v2x_polyarchy v2clgencl e_miferrat gdp_growth year) xlabel(, labsize(small)) xline(0, lwidth(vthin))  ylabel(, labsize(small)) byopts(rows(1) legend(off))  levels(95) msize(vsmall) mcolor(black..) ciopts(recast(rcap)lwidth(vthin) lcolor(gs10))


**********************************************************************************************************************************
*************Figure 3**********

***Note: Graph dimensions altered manually for presentation. Excludes first 3 years of time series due to moving avarage calculation
***********************************************************************************************************************************

by year, sort: egen mean_IPU_API = mean(IPU_API)

by year, sort: egen mean_v2lgfemleg = mean(v2lgfemleg)

keep year  mean_v2lgfemleg mean_IPU_API

gen ccode=1

duplicates drop

tsset ccode year

tssmooth ma ma_IPU_API = mean_IPU_API, window(3 1)

tssmooth ma ma_mean_v2lgfemleg = mean_v2lgfemleg, window(3 1)

drop if year < 1993

twoway line ma_IPU_API year, yaxis(1)  || bar ma_mean_v2lgfemleg year, yaxis(2) 

graph save "Graph" "Fig3.gph", replace


clear



**********************************************************************************************************************************
*************Figure 2

*************Note that this figure requires using a diffirent dataset and the relevant shape file

*************Colors were adjusted manually after map creation to improve readability
*******************************************************************************************************************

clear


****Load map file

use "world_3_shp.dta"

***load country candidacy means dataset

use "map_data.dta"

***create map

spmap mean_candidacy using world_3_shp.dta, id(id) fcolor(Purples)  legstyle(0) legend(on) legend(label(2  "< 5") label(3 "5 to 14") label(4 "15 to 24") label(5 "25 to 39") label(6 ">40") size(2.0)) clbreaks(0 5 15 25 40 60) clmethod(custom)

graph save "Graph" "Fig2.gph", replace

log close


clear





